package ru.susu.algebra.chartable.constructor;

import java.math.BigInteger;
import java.util.List;

import ru.susu.algebra.chartable.IPermutationsGroupCharTable;
import ru.susu.algebra.chartable.SymmetricGroupArrayBasedCharTable;
import ru.susu.algebra.partition.IPartitionConstructor;
import ru.susu.algebra.partition.Partition;
import ru.susu.algebra.partition.PartitionsCacheConstructor;
import ru.susu.algebra.partition.filter.AllPartitionsFilter;

/**
 * @author akargapolov
 * @since: 03.03.2009
 */
public class SymmetricGroupArrayTableConstructor extends SymmetricGroupTableConstructorBase
{


	@Override
	protected IPermutationsGroupCharTable<BigInteger> createTable(Partition p)
	{
		int sum = p.getPresentedNumber();
		IPartitionConstructor constructor = new PartitionsCacheConstructor();
		List<Partition> partitions = constructor.getAscendingPartitions(sum, new AllPartitionsFilter());
		return new SymmetricGroupArrayBasedCharTable<BigInteger>(partitions.size());
	}

}
